﻿using System.Collections.Generic;
using System.Reflection;

using HttpApiGateway.Model;

using RpcHelper;

namespace HttpApiGateway.Helper
{
    internal class FuncHelper
    {

        public static FuncParam[] InitMethod(MethodInfo method)
        {
            List<int> rets = new List<int>();
            FuncParam[] list = method.GetParameters().ConvertAll(a => ApiHelper.GetParamType(a));
            if (list.IsExists(b => b.ParamType == FuncParamType.参数 && !b.IsBasicType))
            {
                list.ForEach(a => a.ParamType == FuncParamType.参数 && a.IsBasicType, a =>
                {
                    a.ReceiveMethod = "GET";
                });
            }
            return list;
        }
    }
}
